{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<style type="text/css">
		.mask .mask-content{height: 17vh}
		.img-1{height: 80px !important;width: 80px!important;}
	</style>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.title}}</h1></dt>
				<dd><form method="get"><input type="number" class="input" placeholder="请输入您需要搜索的订单号！" name="search"><input type="submit" value="搜索" class="button" /></form></dd>
			</dl>
		</div>
		<div class="nav1">
			<ul>
				<a href="{{.urlc}}"><li {{if eq .agree ""}}{{if eq .check ""}}class="no"{{end}}{{end}}>全部退款订单</li></a>
				<a href="{{.urlc}}&agree=0"><li {{if eq .agree "0"}}class="no"{{end}}>待同意</li></a>
				<a href="{{.urlc}}&agree=1"><li {{if eq .agree "1"}}class="no"{{end}}>已同意</li></a>
				<a href="{{.urlc}}&agree=2"><li {{if eq .agree "2"}}class="no"{{end}}>不同意</li></a>
				<a href="{{.urlc}}&check=0"><li {{if eq .check "0"}}class="no"{{end}}>未检查</li></a>
				<a href="{{.urlc}}&check=1"><li {{if eq .check "1"}}class="no"{{end}}>检查合格</li></a>
				<a href="{{.urlc}}&check=2"><li {{if eq .check "2"}}class="no"{{end}}>检查不合格</li></a>
			</ul>
		</div>
		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						下方是{{.title}}列表<br>
						<p> 如有特殊需要,在未付款的时候开业修改订单的价格</p>
					</dt>
				</dl>
			</div>

			<table class="table">
				<thead><th width="15%">用户</th><th width="30%">订单信息</th><th width="30%">申请信息</th><th width="15%">操作</th></thead>
				{{range .info}}
				<tr id="{{.id}}" class="gray">
					<td class="center"><a href="/admin/member/content?id={{.uid}}" class="tz"><img src="{{.pathname}}" class="img-1"><br>{{.monicker}}</a></td>
					<td>
						订单号：<a href="/admin/order/content?id={{.id}}" class="tz">{{.ordernum}}</a><br>
						订单价格：&yen;{{.money}}<br>
						已退金额：&yen;{{.rmoney}}<br>
						<!-- 需退金额：<b style="color:#e54242">&yen;{{.returnmoney}}</b><br> -->
						是否同意：{{if eq .agree "0"}}未处理{{else if eq .agree "1"}}已同意{{else if eq .agree "2"}}不同意{{end}}<br>
						检查情况：{{if eq .check "0"}}未处理{{else if eq .check "1"}}检查合格{{else if eq .check "2"}}检查不合格{{end}}<br>
					</td>
					<td>
						退换类型：{{if eq .type "0"}}退货{{else}}换货{{end}}<br>
						退换原因：{{.whys}}<br>
						退换说明：{{.intr}}<br>
						申请时间：{{.addtime}}<br>
						退换时间：{{.returntime}}<br>
					</td>
					<td class="operation">
						{{if eq .return "0"}}
						{{if eq .agree "0"}}
						<a class="agree" data-agree="1" data-id="{{.id}}">同意</a><br>
						<a class="agree" data-agree="2" data-id="{{.id}}">不同意</a><br>
						{{else if eq .agree "1"}}
						{{if eq .check "0"}}
						<a class="check" data-check="1" data-id="{{.id}}">检查合格</a><br>
						<a class="check" data-check="2" data-id="{{.id}}">检查不合格</a><br>
						{{else if eq .check "1"}}
						<a class="return" data-id="{{.id}}">退款</a>
						{{end}}
						{{end}}
						{{else}}
						已退款
						{{end}}
					</td>
				</tr>				
				<!-- <thead><th colspan="8">产品信息</th></thead> -->
				{{end}}
				{{if ne .paginator.totalpages 1}}
					<tr>
						<td  colspan="5">
							<div class="paging">
								{{if ne .paginator.currpage 1}}
								<a href="{{$.url}}page={{.paginator.firstpage}}">首页</a>
								<a href="{{$.url}}page={{.paginator.prevpage}}">&lt;&lt;</a>
								{{else}}
								<a class="disable">首页</a>
								<a class="disable">&lt;&lt;</a>
								{{end}}
								{{range $index,$page := .paginator.pages}}
								{{if eq $.paginator.currpage $page}} 
								<a class="no">{{$page}}</a>
								{{else}}
								<a href="{{$.url}}page={{$page}}">{{$page}}</a>
								{{end}}
								{{end}}
								{{if eq .paginator.currpage .paginator.totalpages}}
								<a class="disable">&gt;&gt;</a>
								<a class="disable">尾页</a>
								{{else}}
								<a href="{{$.url}}page={{.paginator.nextpage}}">&gt;&gt;</a>
								<a href="{{$.url}}page={{.paginator.totalpages}}">尾页</a>
								{{end}}
							</div>
						</td>
					</tr>
				{{end}}
			</table>


		</div>
	<div class="mask">
		<div class="mask-content">
			<form id="parameter">
				<table class="table1">
					<thead><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th></thead>
					<tr>
						<td class="genre" colspan="2">原价</td>
						<td colspan="6">
							<input type="text" class="input95" placeholder="请输入要修改的价格！" readonly="" id="money">
						</td>
					</tr>
					<tr>
						<td class="genre" colspan="2">价格</td>
						<td colspan="6">
							<input type="text" class="input95" placeholder="请输入要修改的价格！" name="price">
						</td>
					</tr>
				</table>
				<input type="hidden" name="id">
			</form>
			<p id="tip"></p>
			<div class="mask-form">
				<dl>
					<dt>
						<button id="qr">保存</button>
						<button id="cancle">取消</button>
					</dt>
					<dd>
					</dd>
				</dl>
			</div>
		</div>
	</div>
	<style type="text/css">
		.maskdriver{position: fixed;top: 0;left: 0;background-color: rgba(0,0,0,0.3);z-index: 10000;width: 100vw;height: 100vh;display: none;}
		.maskdriver ul{height: 40vh;width: 150px;position: absolute;top: 30vh;left: calc(50% - 75px);z-index: 10001;background: #fff;
			overflow-y: scroll;padding: 15px}
		.maskdriver ul li{width: 100%;overflow:hidden;padding: 5px 0;border-bottom: 1px solid #eee}
		.maskdriver ul li img{width: 40px;height: 40px;float: left;}
		.maskdriver ul li div{width:calc(100% - 40px)height:40px;float: left;}
		.maskdriver ul li div p{line-height: 20px;font-size: 14px;padding-left: 10px}
		.maskdriver ul li div p:nth-of-type(2){font-size: 12px;color: #666}
	</style>
	<div class="maskdriver">
		<ul>
			{{range .driver}}
			<li class="driverlist" data-id="{{.id}}" data-monicker="{{.monicker}}">
				<img src="{{.pathname}}">
				<div>
					<p>{{.monicker}}</p>
					<p>{{.name}}</p>
				</div>
			</li>
			{{end}}
		</ul>
	</div>
	</article>
</section>
<footer></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.agree').click(function(){
		var id=$(this).attr('data-id');
		var agree=$(this).attr('data-agree');
		var tip;
		if(agree==1){
			tip=`您确定同意退款吗?`
		}else{
			tip=`您确定不同意退款吗?`
		}
		wxc.xcConfirm(tip,"confirm",{onOk:function(){
			$.ajax({
				url:'/admin/order/return_agree',
				data:{id:id,agree:agree},
				success:function(res) {
					if(res==1){
						history.go(0)
					}else{
						wxc.xcConfirm("操作失败,请重试","error");
					}
				}
			})
		}});
	})
	$('.check').click(function(){
		var id=$(this).attr('data-id');
		var check=$(this).attr('data-check');
		var tip;
		if(check==1){
			tip=`您确定退货检查合格吗?`
		}else{
			tip=`您确定退货检查不合格吗?`
		}
		wxc.xcConfirm(tip,"confirm",{onOk:function(){
			$.ajax({
				url:'/admin/order/return_check',
				data:{id:id,check:check},
				success:function(res) {
					if(res==1){
						history.go(0)
					}else{
						wxc.xcConfirm("操作失败,请重试","error");
					}
				}
			})
		}});
	})
	$('.return').click(function(){
		var id=$(this).attr('data-id');
		wxc.xcConfirm("请输入您要退款的金额","input",{onOk:function(data){
			console.log(data)
			$.ajax({
				url:'/admin/order/return_money',
				data:{id:id,money:data},
				success:function(res) {
					if(res==1){
						history.go(0)
					}else{
						wxc.xcConfirm("操作失败,请重试","error");
					}
				}
			})
		}});
		$('.inputBox').attr('type','number')
	})
</script>
</body>
</html>
